package com.gzxxgl.util;

/**
 * @author 作者 E-mail:
 * @date 创建时间：2017年3月18日 下午6:41:35
 * @version 1.0
 * @parameter
 * @since
 * @return
 */
public class Count {

	public static double tax(double before) {

		final double porint = 3500, porint1 = 5000, porint2 = 8000, porint3 = 12500, porint4 = 38500, porint5 = 58500,
				porint6 = 83500;

		final double shuilv1 = 0.03, shuilv2 = 0.1, shuilv3 = 0.2, shuilv4 = 0.25, shuilv5 = 0.3, shuilv6 = 0.35,
				shuilv7 = 0.45;

		final double h = 45, i = 345, j = 1245, k = 7745, l = 13745, m = 22495;

		double after, suodeshui = 0;
		if (before >= porint && before < porint1) {

			suodeshui = ((before - porint) * shuilv1);

		} else if (before >= porint1 && before < porint2) {

			suodeshui = h + ((before - porint1) * shuilv2);

		} else if (before >= porint2 && before < porint3) {

			suodeshui = i + ((before - porint2) * shuilv3);

		} else if (before >= porint3 && before < porint4) {

			suodeshui = j + ((before - porint3) * shuilv4);

		} else if (before >= porint4 && before < porint5) {

			suodeshui = k + ((before - porint4) * shuilv5);

		} else if (before >= porint5 && before < porint6) {

			suodeshui = l + ((before - porint5) * shuilv6);

		} else if (before >= porint6) {

			suodeshui = m + ((before - porint6) * shuilv7);

		} else {

			suodeshui = 0;
		}
		after = before - suodeshui; // 把这句放到这里。
		System.out.print(before + "元" + "," + "税后收入为" + after + "元" + "," + "您缴纳的个人所得税为：" + suodeshui + "元");

		return suodeshui;
	}

	public static void main(String[] args) {
		Count.tax(5113.19);
	}
}
